x11: fix crash on idle compute size without layout
authorRafostar <40623528+Rafostar@users.noreply.github.com>
Sun, 3 Jan 2021 17:02:31 +0000 (18:02 +0100)
committerRafostar <40623528+Rafostar@users.noreply.github.com>
Sun, 3 Jan 2021 17:02:31 +0000 (18:02 +0100)
On x11 toplevel layout is not created before toplevel
is presented, but GTK tries to update it on idle
which leads to a crash due to accessing property
of undefined object. Treat soon to be created layout
as a layout with default values upon creation (resizable).

gdk/x11/gdksurface-x11.c

index d67dacf77c00f00466029569120fb6a142201d6b..207c34e419e824a7a25dd0b7901bfc3eaa8fda6a 100644 (file)
@@ -291,7 +291,7 @@ compute_toplevel_size (GdkSurface *surface,
       GdkGeometry geometry;
       GdkSurfaceHints mask;
 
-      if (gdk_toplevel_layout_get_resizable (impl->toplevel_layout))
+      if (!impl->toplevel_layout || gdk_toplevel_layout_get_resizable (impl->toplevel_layout))
         {
           geometry.min_width = size.min_width;
           geometry.min_height = size.min_height;